var buttonNormal : Texture2D;
var buttonHover : Texture2D;
var buttonClick : Texture2D;

var strawberryCount : GameObject;
var mainCamera : GameObject;

private var strawberryScript : StrawberriesCount;
private var clickScript : ClickScript;

function Start (){
	strawberryScript = strawberryCount.gameObject.GetComponent("StrawberriesCount");
	clickScript = mainCamera.gameObject.GetComponent("ClickScript");
}


function OnMouseEnter()
{
	renderer.material.mainTexture = buttonHover;
	
}

function OnMouseExit()
{
	renderer.material.mainTexture = buttonNormal;
}

function OnMouseDown()
{
	renderer.material.mainTexture = buttonClick;
}

function OnMouseUp()
{
	if (strawberryScript.strawberryCount > 0){
		strawberryScript.Decrease();
		clickScript.DecreaseTotal();
	}
}